import { Component } from '@angular/core';
export class Hero {
  id: number;
  name: string;
}

const HEROES: Hero[] = [
  { id: 1, name: '乔峰' },
  { id: 2, name: '段誉' },
  { id: 3, name: '虚竹' },
  { id: 4, name: '慕蓉复' },
  { id: 5, name: '张三峰' }
];

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})


export class AppComponent {
  title = '英雄之旅';
  heroes = HEROES;
  selectedHero: Hero;
  onSelect(hero: Hero): void {
    this.selectedHero = hero;
  }
}
